{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "7c3a1cee-22f5-4c74-9cc1-3d03cd865313",
   "metadata": {},
   "source": [
    "Chapter 07\n",
    "# for … else … 语句例子\n",
    "Book_1《编程不难》 | 鸢尾花书：从加减乘除到机器学习 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "cd623e8e-a424-456d-a3fe-bc1b09cac030",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "1\n",
      "2\n",
      "3\n",
      "4\n",
      "5\n",
      "6\n",
      "7\n",
      "8\n",
      "9\n",
      "For loop finished\n"
     ]
    }
   ],
   "source": [
    "for x in range(10):\n",
    "    print(x)\n",
    "else: # for循环结束后会执行\n",
    "    print(\"For loop finished\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b20e000f-e318-41b9-aaa9-5d61b4e274a0",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
